roundedbox: Remove functions that take a GtkThemingEngine
authorBenjamin Otte <otte@redhat.com>
Mon, 16 Jun 2014 02:28:06 +0000 (04:28 +0200)
committerBenjamin Otte <otte@redhat.com>
Sat, 16 Aug 2014 17:39:44 +0000 (19:39 +0200)
Instead, make the functions use a GtkStyleContext argument.

gtk/gtkroundedbox.c
gtk/gtkroundedboxprivate.h
gtk/gtkthemingengine.c

index 5aa53def2ab769034a102158997ad7b78089c7c9..c3e2650e4cb85e2c7411f405c7b3025500eb171d 100644 (file)
@@ -22,7 +22,6 @@
 #include "gtkcsscornervalueprivate.h"
 #include "gtkcsstypesprivate.h"
 #include "gtkstylecontextprivate.h"
-#include "gtkthemingengineprivate.h"
 
 #include <string.h>
 
@@ -131,24 +130,16 @@ _gtk_rounded_box_apply_border_radius_for_context (GtkRoundedBox    *box,
 }
 
 void
-_gtk_rounded_box_apply_border_radius_for_engine (GtkRoundedBox    *box,
-                                                 GtkThemingEngine *engine,
-                                                 GtkJunctionSides  junction)
-{
-  _gtk_rounded_box_apply_border_radius_for_context (box, _gtk_theming_engine_get_context (engine), junction);
-}
-
-void
-_gtk_rounded_box_apply_outline_radius_for_engine (GtkRoundedBox    *box,
-                                                  GtkThemingEngine *engine,
-                                                  GtkJunctionSides  junction)
+_gtk_rounded_box_apply_outline_radius_for_context (GtkRoundedBox    *box,
+                                                   GtkStyleContext  *context,
+                                                   GtkJunctionSides  junction)
 {
   GtkCssValue *corner[4];
 
-  corner[GTK_CSS_TOP_LEFT] = _gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS);
-  corner[GTK_CSS_TOP_RIGHT] = _gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_OUTLINE_TOP_RIGHT_RADIUS);
-  corner[GTK_CSS_BOTTOM_LEFT] = _gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS);
-  corner[GTK_CSS_BOTTOM_RIGHT] = _gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS);
+  corner[GTK_CSS_TOP_LEFT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS);
+  corner[GTK_CSS_TOP_RIGHT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_OUTLINE_TOP_RIGHT_RADIUS);
+  corner[GTK_CSS_BOTTOM_LEFT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS);
+  corner[GTK_CSS_BOTTOM_RIGHT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS);
 
   _gtk_rounded_box_apply_border_radius (box, corner, junction);
 }
index 6bc96faf81da9a3f964adac0f619ad319900723c..753c5c237a7688865a07d0b8a6ad5117650a13a8 100644 (file)
@@ -21,7 +21,7 @@
 #include <glib-object.h>
 #include <cairo.h>
 #include <gtk/gtkenums.h>
-#include <gtk/gtkthemingengine.h>
+#include <gtk/gtktypes.h>
 
 #include "gtkcsstypesprivate.h"
 
@@ -47,16 +47,13 @@ void            _gtk_rounded_box_init_rect                      (GtkRoundedBox
                                                                  double               width,
                                                                  double               height);
 
-void            _gtk_rounded_box_apply_border_radius_for_engine (GtkRoundedBox       *box,
-                                                                 GtkThemingEngine    *engine,
+void            _gtk_rounded_box_apply_border_radius_for_context (GtkRoundedBox      *box,
+                                                                 GtkStyleContext     *context,
                                                                  GtkJunctionSides     junction);
-void            _gtk_rounded_box_apply_border_radius_for_context (GtkRoundedBox    *box,
-                                                                  GtkStyleContext  *context,
-                                                                  GtkJunctionSides  junction);
 
-void            _gtk_rounded_box_apply_outline_radius_for_engine (GtkRoundedBox       *box,
-                                                                  GtkThemingEngine    *engine,
-                                                                  GtkJunctionSides     junction);
+void            _gtk_rounded_box_apply_outline_radius_for_context (GtkRoundedBox     *box,
+                                                                 GtkStyleContext     *context,
+                                                                 GtkJunctionSides     junction);
 
 void            _gtk_rounded_box_grow                           (GtkRoundedBox       *box,
                                                                  double               top,
index 98a297c05a83410a22ad5bbf3f23dff85cfc55d4..bdb10d241b6df5d91e3565e58b15b4e06a074d80 100644 (file)
@@ -1776,7 +1776,7 @@ render_frame_internal (GtkThemingEngine *engine,
       colors[3] = *_gtk_css_rgba_value_get_rgba (_gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_BORDER_LEFT_COLOR));
 
       _gtk_rounded_box_init_rect (&border_box, x, y, width, height);
-      _gtk_rounded_box_apply_border_radius_for_engine (&border_box, engine, junction);
+      _gtk_rounded_box_apply_border_radius_for_context (&border_box, engine->priv->context, junction);
 
       render_border (cr, &border_box, border_width, hidden_side, colors, border_style);
     }
@@ -1941,7 +1941,7 @@ gtk_theming_engine_render_focus (GtkThemingEngine *engine,
                                - border_width[GTK_CSS_RIGHT] - offset,
                                - border_width[GTK_CSS_LEFT] - offset,
                                - border_width[GTK_CSS_BOTTOM] - offset);
-      _gtk_rounded_box_apply_outline_radius_for_engine (&border_box, engine, GTK_JUNCTION_NONE);
+      _gtk_rounded_box_apply_outline_radius_for_context (&border_box, engine->priv->context, GTK_JUNCTION_NONE);
 
       render_border (cr, &border_box, border_width, 0, colors, border_style);
     }